{include file="public/header" /} {include file="public/lefter" /}
<div class="container-fluid box-a">
	<div class="nav-c">
		<span class="glyphicon glyphicon-tag">&nbsp;<span id="">编辑用户组</span>
	</div>
	<style type="text/css">
		.panel{
			border-radius:1px;
			margin-bottom: 10px;
		}
	</style>
	<box class="box-b">
		<div class="divs" class="row">
			<div class="page-header page-s">
				<h2>编辑用户组<small></small></h2>
			</div>
			<form id="add" class="form-horizontal">
				<div class="form-group">
					<input type="hidden" name="g_id" value="{$groupdb['id']}" />
					<label for="inputtitle" class="col-sm-3 col-md-3 col-lg-2 control-label">用户组名称</label>
					<div class="col-sm-8 col-md-6 col-lg-4">
						<input type="text" name="title" class="form-control" id="inputname" placeholder="用户组名称" value="{$groupdb['title']}" />
					</div>
					<label style="color: red;" for="inputnetonoff" class="control-label">*</label>
				</div>
				<div class="form-group">
					<label for="inputs" class="col-sm-3 col-md-3 col-lg-2 control-label">用户组说明</label>
					<div class="col-sm-8 col-md-6 col-lg-4">
						<input type="text" name="description" class="form-control" placeholder="用户组说明" value="{$groupdb['description']}" />
					</div>
					<label style="color: red;" for="inputnetonoff" class="control-label"></label>
				</div>
				<div class="form-group">
					<label for="inputs" class="col-sm-3 col-md-3 col-lg-2 control-label">权限管理</label>
					<div class="col-sm-9 col-md-9 col-lg-8">
						{volist name="resgroup" id="vo"}
                            <div class="panel panel-default">
                            <div class="panel-heading">
                            	
                                <h3 class="panel-title">{$vo.group}</h3>
                            </div>
                            <div class="panel-body" id="box">
                            	<div class="checkbox form-group">
                                {volist name="resrule" id="vi"}                                
                                {if condition="$vo.group == $vi.group "}                                
                                <label>
                                <input type="checkbox" name="rules[]" value="{$vi.id}" {if condition="$vi.checked == 1"}checked="checked"{/if}> {$vi.title}
                                </label>                                                                
                                {/if}
                                {/volist}
                                </div>
                            </div>
                            </div>
                        {/volist}
						    
					</div>
					<label style="color: red;" for="inputnetonoff" class="control-label"></label>
				</div>
				<div class="form-group">
					<div class="col-sm-offset-3 col-md-offset-3 col-lg-offset-2 col-sm-8 col-md-6 col-lg-4">
						<input type="checkbox" onclick="checkAll(this)">全选
						<a class="btn btn-warning" href="javascript:history.back(-1)" role="button">返回</a>
						<button id="subadd" class="btn btn-primary">保存</button>
					</div>
				</div>
			</form>
		</div>
	</box>
</div>
{include file="public/flooter" /}
<script type="text/javascript">
	$(document).ready(function() {		
		$('#subadd').click(function() {
			var str_data = $("#add").serialize();			
			$.ajax({
				type: "get",
				url: "",
				data: str_data,
				success: function(msg) {
					layer.msg(msg);
					
				}
			});
			return false;
		});
		
	});
	function checkAll(obj){
        $("#box input[type='checkbox']").prop('checked', $(obj).prop('checked'));
    }
</script>

